﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Zsnd.Helpers {
    public class UnEqualComparer<T> : IEqualityComparer<T> {
        public bool Equals(T x, T y) {

            //Check whether the compared objects reference the same data.
            if (Object.ReferenceEquals(x, y)) return false;

            //Check whether any of the compared objects is null.
            //if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null))
            //    return false;

            return true;
        }

        public int GetHashCode(T s) {
            return s.GetHashCode();
        }
    }
    public class UnEqualComparer : IEqualityComparer<int> {
        public bool Equals(int x, int y) {

            //Check whether the compared objects reference the same data.
            if (x == y) return false;

            //Check whether any of the compared objects is null.
            //if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null))
            //    return false;

            return true;
        }

        public int GetHashCode(int s) {
            return s.GetHashCode();
        }
    }
}